#include "scienceclub.h"
#include "ui_scienceclub.h"
#include "QPainter"

Scienceclub::Scienceclub(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Scienceclub)
{
    ui->setupUi(this);
    this->resize(1774,1000);

    //以下构造视频
    /*NKlabel=new QLabel(this);
    //NKmovie=new QMovie(":/Libgif.gif");
    NKlabel->setMinimumSize(1774,1000);//设置标签为最小尺寸

    //QSize si(this->width(),this->height());
    //NKmovie->setScaledSize(si);// 将QMovie与标记相关联
    //NKmovie->setSpeed(100);//设置标签和按钮属性
    NKlabel->setMovie(NKmovie);
    NKmovie->start();
    QObject::connect(NKmovie,&QMovie::frameChanged,[=](){
        int currentFrameNumber = NKmovie->currentFrameNumber();
        int framecount = NKmovie->frameCount();
        if (currentFrameNumber == framecount-1)//如果已经播放到最后一帧，则停止播放
        {
            //NKmovie->stop();
            //this->close();
        }
    });
    QObject::connect(NKmovie, SIGNAL(frameChanged(int)), this, SLOT(onFrameChanged(int)));
*/

}

void Scienceclub::paintEvent(QPaintEvent* event)//作图用函数
{
    QPainter painter(this);
        painter.drawPixmap(0,0,1090,1000,QPixmap(":/scene/sciencecl.png"));
}

Scienceclub::~Scienceclub()
{
    delete ui;
}

void Scienceclub::on_pushButton_clicked()
{
    engineer=new engineering;
    engineer->show();
}

void Scienceclub::on_pushButton_2_clicked()
{
    environ=new environmental;
    environ->show();
}

void Scienceclub::on_pushButton_3_clicked()
{
    medic=new medical;
    medic->show();
}
